home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / dollarformat.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  789 b   |  28 lines

  1. <!--- This example shows the use of DollarFormat --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. DollarFormat Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  10. <BODY  bgcolor="#FFFFD5">
  11. <H3>DollarFormat Example</H3>
  12.  
  13. <CFLOOP from=8 to=50 index=counter>
  14. <CFSET full = counter>
  15. <CFSET quarter = Evaluate(counter + (1/4))>
  16. <CFSET half = Evaluate(counter + (1/2))>
  17. <CFSET threefourth = Evaluate(counter + (3/4))>
  18. <CFOUTPUT>
  19. <PRE>
  20. bill    #DollarFormat(full)#    #DollarFormat(quarter)#    #DollarFormat(half)#  #DollarFormat(threefourth)#
  21. 18% tip    #DollarFormat(Evaluate(full * (18/100)))#    #DollarFormat(Evaluate(quarter * (18/100)))#    #DollarFormat(Evaluate(half * (18/100)))#    #DollarFormat(Evaluate(threefourth * (18/100)))#
  22. </PRE>
  23. </CFOUTPUT>
  24. </CFLOOP>
  25.  
  26. </BODY>
  27. </HTML>       
  28.